﻿using Microsoft.AspNetCore.Components;

namespace BlazorApp1.Component
{
    partial class ConfirmButton:ComponentBase
    {
        bool showConfirm = false;
        [CascadingParameter(Name = "ThemeName")]
        public string? Name { get; set; }
        [Parameter]
        public string textvalue { get; set; } = "delete";

        [Parameter]
        public EventCallback OnConfirmed { get; set; }

        void ShowConfirm()
        {
            showConfirm = true;
        }
            
        void Cancel()
        {
            showConfirm = false;
        }

        async Task Confirm()
        {
            showConfirm = false;
            await OnConfirmed.InvokeAsync();
        }
    }
}
